// <![CDATA[
if(navigator.cookieEnabled){//判断是否支持Cookie
     var tag = document.getElementById("History");//输出结果DIV id
     var N = 18;//太长标题截取汉字字数
     var listCount = 10;//记录和显示最近几条
     var expTime = new Date(new Date().setDate(new Date().getDate() + 500));//设定过期时间为500天
     var edp = "|; expires=" + expTime.toGMTString() + "; path=/"; //; domain=xiaolin.net //组合Cookie参数
     var allCookie = document.cookie; //取出全部Cookie
         var myCookieStart = allCookie.indexOf("news=") + "news=".length;
         var myCookieEnd = allCookie.indexOf("$|",myCookieStart);
         var myCookieall = unescape(allCookie.substring(myCookieStart,myCookieEnd));
         var myCookie = myCookieall.split("$");
         var myCookieTit = new Array();
         var myCookieUrl = new Array();
         for(var i = 0; i < myCookie.length; i++){
             var myCookieOne = myCookie[i].split("^");
             myCookieTit[i] = myCookieOne[0];
             myCookieUrl[i] = myCookieOne[1];
         }
         var tagDat = "";
         for(var i =myCookieTit.length - 1; i >= 0; i--){//从先到后顺序取得结果值
             var textCount = myCookieTit[i].replace(/[^\x00-\xff]/g,"aa").length;
             if(textCount <= N*2){
                 texts = myCookieTit[i];
             }else{
                 for(var a = N; a < textCount; a++){
                     texts = myCookieTit[i].substr(0,a);
                     if(texts.replace(/[^\x00-\xff]/g,"aa").length >= N*2){
                         texts += "..."
                         break;
                     }
                 }
             }
             tagDat += "<div class=\"box g-clear\"><img class=\"img\" src=\"/static/nocover.jpg\"><div class=\"search-item-info\"><h3><a class=\"am-btn am-btn-default lipbtn\" href=\"" + myCookieUrl[i] + "\"" + " title=\"" + myCookieTit[i] + "\"><b>" + texts + "</b></a></h3></div></div>"
         }
     tag.innerHTML =tagDat;//输出结果给页面div
}else{//不支持Cookie的处理
     tag.innerHTML="您浏览器关闭了cookie功能，不能为您自动保存最近浏览过的网页。"
}
// ]]>